<!--
  @author duanzuocai
  @since 18/10/25 15:20
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>组织架构管理</title>
</head>
<body>

<div class="layui-fluid">

    <!--面包屑-->
    <blockquote class="layui-crumb">
        组织关系>
        <a lay-href="/system/organ/list.action" lay-text="组织架构" th:text="组织架构">组织架构</a>
        <zmn th:each="organ, organState : ${organs}">
            <zmn th:if="${organState.last}" th:text="${'>'+organ.orgName}"></zmn>
            <a th:if="${!organState.last}" th:href="${'/system/organ/list.action?parentId='+organ.orgId}" >>[[${organ.orgName}]]</a>
        </zmn>
    </blockquote>

    <div class="layui-card">

        <div class="layui-card-body">

            <!--<form method="post" action="/system/organ/list.action">-->
                <!--<div class="layui-form layui-margin-t" th:include="mc/organ/_query :: query "></div>-->
            <!--</form>-->

            <table class="layui-hide" id="zmn-table" lay-filter="zmn-table"></table>
            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm changeStatus" lay-event="start"
                                th:if="${#authPermit.checkPermit('/system/organ/updateStatus.action')}">启用</button>
                        <button class="layui-btn layui-btn-sm layui-btn-danger changeStatus" lay-event="stop"
                                th:if="${#authPermit.checkPermit('/system/organ/updateStatus.action')}">停用</button>
                    </div>
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm layui-btn-primary" th:if="${#authPermit.checkPermit('/system/organ/detail.action')}"
                                th:lay-href="|/system/organ/detail.action?parentId=${vo.parentId==null?1:vo.parentId}&flag=1|">新增</a>
                        </button>
                        <button class="layui-btn layui-btn-sm layui-btn-primary" th:if="${vo.parentId!=null}"  onclick="layui.admin.events.closeThisTabs();">
                            返回上级组织
                        </button>
                        <!--<a th:if="${parent.orgId!=null}" th:href="|/system/organ/list.action?parentId=${parent.parentId}|" class="layui-btn layui-btn-sm">-->
                            <!--&lt;!&ndash;<button class="layui-btn layui-btn-sm">&ndash;&gt;-->
                                <!--&lt;!&ndash;<i class="layui-icon"></i>&ndash;&gt;-->
                            <!--返回上级-->
                            <!--&lt;!&ndash;</button>&ndash;&gt;-->
                        <!--</a>-->
                    </div>
                </div>
            </script>
        </div>

    </div>
</div>

<script type="text/javascript" th:inline="javascript">
    var json = {
        hasView: [[${#authPermit.checkPermit('/system/organ/list.action')}]],
        hasDetail: [[${#authPermit.checkPermit('/system/organ/detail.action')}]],
        hasEdit: [[${#authPermit.checkPermit('/system/organ/updateSortAndName.action')}]],
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]],
        // items: [[${items}]],
        // parent:[[${parent}]],
        vo:[[${vo}]]
    };

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        art_organ_list: "mc/organ/zmn.art.mc.organ.list",
        treeGrid: '{/}/static/js/layui/treeGrid/treeGrid',
    }).use(['index', 'art_organ_list']);

</script>
</body>
</html>